<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <cpn1></cpn1>
        <cpn2></cpn2>
    </div>

    <script src="../js/vue.js"></script>
    <script>
        //全局组件注册的语法糖
        Vue.component('cpn1',{
            template: `
                <div>
                    <h2>苏州大学</h2>  
                    <p>养天地正气,法古今完人</p>  
                </div>
            `
        })

        const app = new Vue({
            el: '#app',
            data: {
                message: '苏州大学'
            },
            components: {
                'cpn2':{ //局部组件注册的语法糖
                    template: `
                        <div>
                            <h2>苏州大学</h2>  
                            <p>养天地正气,法古今完人</p>  
                        </div>
                    `
                }
            }
        })
    </script>
</body>
</html>